let express = require("express");

let app = express();
let webpack = require("webpack");

//中间件
let middle = require("webpack-dev-middleware");
let config = require("./webpack.config.js");
console.log(config);
let compiler = webpack(config);

app.use(middle(compiler))

app.get("/user", (req, res) => {
  res.json({ name: "前端小溪" });
});

app.listen(3001, () => {
  console.log("3001已启动");
});
